/**
 * 
 */
package service;

import service.exception.ServiceException;

/**
 * The service manager interface.
 * 
 * A service manger is an interface that provides a set of services in a unified
 * way for the controller to call and it contains a collection of business logic
 * in each service.
 * 
 * A service manager contains multiple services which each handles a specific
 * set of functionalities and has a customized input and output.
 * 
 * @author chuxiaoyuan
 * 
 */
public interface IServiceManager {

	/**
	 * The interface method for execute the specified service.
	 * 
	 * @param serviceName
	 *            the name of the service.
	 * @param in
	 *            the input parameter (can be void or at most <code>MAX_ARGUMENTS</code> parameters).
	 *            
	 * @return the service output (if service returns void, this method returns null).
	 * @throws ServiceException
	 *             service exception.
	 */
	<IN, OUT> OUT execute(
			String serviceName, IN... in) throws ServiceException;
	
	/**
	 * The maximum number of arguments the 
	 * <code>execute</code> can take as additional parameters.
	 */
	static final int MAX_ARGUMENTS = 10;
}
